local total = achievements.GetValue( "Strong Knees", "total", 0 )
local function Update(ply, bind, pressed)
	if ( bind != "+duck" ) then return end
	
	local ply = LocalPlayer()
	if ( !ValidEntity( ply ) ) then return end
		
	if ( (total != 1000) && !ply:Crouching() ) then
		total = math.Clamp( total + 1, 0, 1000 )
		achievements.Update( "Strong Knees", total / 1000, total .. "/1000" )
		achievements.SetValue( "Strong Knees", "total", total )
	end
end
hook.Add( "PlayerBindPress", "Achievement.StrongKnees", Update )

achievements.Register( "Strong Knees", "Crouch 1000 times total.", "achievements/strongknees", total / 1000, total .. "/1000" )